<include file="common/hearder"/>

<form method="post" enctype="multipart/form-data" style="width: 350px;float: left" >
    <div class="form-group">
        <label for="event">名称:</label>
        <input type="text" class="form-control" id="event" name="event"  value="{$salary.event}" readonly>
    </div>
    <div class="form-group">
        <label for="entry_person">录入人:</label>
        <input type="text" class="form-control" id="entry_person" name="entry_person"  value="{$salary.entry_person}" readonly>
    </div>
    <div class="form-group">
        <label for="explain">录入说明:</label>
        <input type="text" class="form-control" id="explain" name="explain" value="{$salary.explain}" readonly>
    </div>
    <div class="form-group">
        <label for="cont_time">录入时间:</label>
        <input type="text" class="form-control" id="cont_time" name="cont_time" value="" readonly>
    </div>
    <table border="1px">
        <thead>
        <tr>
            <th>序号</th>
            <th>用户名</th>
            <th>岗位补贴</th>
            <th>职位工资</th>
            <th>奖励金额</th>
            <th>惩罚金额</th>
            <th>实际应得工资</th>
        </tr>
        </thead>
        <foreach name="staffinfo" item="sta">
            <tbody>
            <tr class="trqian">
                <th>{$sta.stf_id}</th>
                <th>{$sta.stf_name}</th>
                <th>
                    <input type="text" style="width: 100px" name="gw" id="gw" value="<?php echo $postinfo[$sta['pt_id']]['subsidy']?>" readonly>
                </th>
                <th>
                    <input type="text" style="width: 100px" name="zw" id="zw" value="<?php echo $postinfo[$sta['pt_id']]['wages']?>" readonly>
                </th>
                <th>
                    <input type="text" style="width: 100px" name="jl" value="<?php echo $postinfo[$sta['pt_id']]['cf']?>">
                </th>
                <th>
                    <input type="text" style="width: 100px" name="kq" id="kq" value="<?php echo $sta['rewards']?>">
                </th>
                <th>
                    <input type="text" style="width: 100px" name="xj" id="xj" value="<?php echo $postinfo[$sta['pt_id']]['m_wages']?>" readonly>
                </th>
            </tr>
            </tbody>
        </foreach>
    </table>

    <input type="hidden" value="1" name="hidden">

    <a href="{:U('index')}"><input type="button" value="返回"></a>
</form>
<script>
    $(function(){
        $('.trqian input').bind('input propertychange', function() {
            var xj=0;
            var gw=$(this).parents('.trqian').children('th').children('input[name="gw"]').val();
            var zw=$(this).parents('.trqian').children('th').children('input[name="zw"]').val();
            var kq=$(this).parents('.trqian').children('th').children('input[name="kq"]').val();
            var jl=$(this).parents('.trqian').children('th').children('input[name="jl"]').val();
            if (parseInt(gw)){
                xj+=parseInt(gw);
            }
            if (parseInt(zw)){
                xj+=parseInt(zw);
            }
            if (parseInt(kq)){
                xj-=parseInt(kq);
            }
            if (parseInt(jl)){
                xj+=parseInt(jl);
            }
            var xj=$(this).parents('.trqian').children('th').children('input[name="xj"]').val(xj);
        });

    })
</script>


<include file="common/footer"/>